//
// Created by mac on 1/26/22.
//
#include <string>
#include <math.h>
using namespace std;

string reverseStr(string s, int k) {
    for (int start = 0; start < s.size(); start+=2*k) {
        int left = start;
        int right = fmin(left+k-1, s.size()-1);
        while (left<right){
            swap(s[left], s[right]);
            left++;
            right--;
        }
    }
    return s;
}